package com.company.kotlinlearn.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

/**
 * @description
 * @author Toosan
 * @time 2022/4/10 15:12
 */
class DataViewModel : ViewModel() {
    private val dataLiveData = MutableLiveData<Int>()
    private var num = 0

    fun getDataLiveData():LiveData<Int> {
        return dataLiveData
    }

    fun plusOne() {
        num ++
        dataLiveData.value = num;
    }

}